package com.csu.soa_library.exception;

import cn.dev33.satoken.exception.NotLoginException;
import com.csu.soa_library.common.CommonResponse;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class GlobalExceptionHandler {
    //处理未登录异常
    @ExceptionHandler(NotLoginException.class)
    public CommonResponse<Object> handleNotLoginException(){
        return CommonResponse.createForError("未登录，请先登录");
    }
}
